/*
  Copyright 2009 Tarek Saidi

  This Prayer Times Plasmoid is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef SALATINOID_ENGINE_H
#define SALATINOID_ENGINE_H

#include <QString>
#include <QTime>
#include <QDate>
#include <Plasma/DataEngine>

class SalatinoidEngine : public Plasma::DataEngine
{
    Q_OBJECT

    public:
        SalatinoidEngine(QObject* parent, const QVariantList& args);
        ~SalatinoidEngine();

    protected:
        bool sourceRequestEvent(const QString &name);
        bool updateSourceEvent(const QString& source);

    private:
        void recalculate();

    private:
        QDateTime times[7];
        int currentPrayer;
        int nextPrayer;
	double latitude;
	double longitude;
        int calculationMethod;
        int seaLevel;
};

#define PRAYER_FAJR        0
#define PRAYER_SHOROUK     1
#define PRAYER_ZUHR        2
#define PRAYER_ASSR        3
#define PRAYER_MAGHRIB     4
#define PRAYER_ISHA        5
#define PRAYER_NISFULLAYL  6

#define DAY_YESTERDAY      0
#define DAY_TODAY          1
#define DAY_TOMORROW       2
#define DAY_AFTER_TOMORROW 3

K_EXPORT_PLASMA_DATAENGINE(salatinoid, SalatinoidEngine)

#endif
